﻿<%@ Page Language="C#" Theme="WebMaster" MasterPageFile="~/WebMaster/MasterPage.master" AutoEventWireup="true" CodeFile="Logo.aspx.cs" Inherits="webapp4U.UI.WebMaster_Default" %>
<%@ Register Src="~/WebMaster/Controls/Title.ascx" TagName="Title" TagPrefix="uc" %>
<%@ Import Namespace="webapp4U" %>
<%@ Register TagPrefix="webapp4U" Namespace="webapp4U.UI" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageContent" Runat="Server">

<uc:Title runat="server" ResourceKey='Logo_LogoManager'  />


<asp:UpdatePanel ID="UpdatePanelContactPersons" runat="server" UpdateMode="Conditional">
<ContentTemplate>


<table align="center" cellpadding="0" cellspacing="0">
<tr>
    <td>
        <table width="100%">
            <tr>
                <td width="50%" align="left">
                    <a href="<%=Globals.ApplicationPath %>WebMaster/Tools/LogoAdd.aspx" class="linkAdd">
                        <%=ResourceManager.GetString("Logo_LogoAdd")%>
                    </a>    
                </td>
                <td width="50%" align="right">
                    <b><%=ResourceManager.GetString("Logo_Position") %>: </b> 
                    <webapp4U:ddlPosition runat="server" ID="dlPosition" CssClass="Textbox" />
                    <asp:Button ID="btSearch" runat="server" Text="Search" OnClick="btSearch_Click" />
                </td>
            </tr>
        </table>
        
    </td>
</tr>
<tr>
    <td align="center">
    <br />
        <asp:GridView runat="server"
                ID="GridViewItem" 
                Width="700" 
                DataSourceID="ObjectDataSource"
                AutoGenerateColumns="false" 
                DataKeyNames="LogoID" 
                AllowPaging="True" 
                AllowSorting="True" 
                PagerSettings-Mode="NumericFirstLast"
                PageSize="25">
                <Columns>
                     <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px" HeaderText="Delete">
                        <HeaderTemplate>
                            <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server" type="checkbox" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox runat="server" ID="chkSelect" ToolTip='<%# Eval("LogoID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Logo" 
                        HeaderStyle-Width="130" 
                        ItemStyle-Width="130" 
                        HeaderStyle-HorizontalAlign="Left"
                        ItemStyle-HorizontalAlign="left">
                        <ItemTemplate>
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td class="BorderImage" align="center" valign="middle">
                                        <a href="<%#Eval("URL")%>" target="_blank">
                                            <img src='<%# Globals.ApplicationPath%>UserUpload/Link/<%#Eval("FileName")%>' border="0" width="100" title="<%#Eval("Url")%>" />
                                        </a>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Url" 
                    HeaderStyle-HorizontalAlign="left"
                    ItemStyle-HorizontalAlign ="left">
                        <ItemTemplate><%# Eval("Url")%></ItemTemplate>
                    </asp:TemplateField>
                  
                    
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="120" HeaderStyle-Width="120" HeaderText="Display Order">
                        <HeaderTemplate><%=ResourceManager.GetString("DisplayOrder") %></HeaderTemplate>
                        <ItemTemplate><%# Eval("DisplayOrder")%></ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40" HeaderStyle-Width="40" HeaderText="Edit">
                        <HeaderTemplate><%=ResourceManager.GetString("Edit") %></HeaderTemplate>
                        <ItemTemplate>
                            <a href="LogoAdd.aspx?LogoID=<%# Eval("LogoID")%>&Action=Edit">
                                <img src="<%=Globals.ImagesUrlWebMaster()%>Edit.gif" border="0" />
                            </a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                </Columns>
                                        
                <EmptyDataTemplate>
                    <table align="center" width="300" border="0" bordercolorlight="#0099cc"  bordercolor="#0099cc">
                        <tr>
                            <td height="50" align="center">
                                <div align="center" id="EmptyData"><%=ResourceManager.GetString("DataEmpty") %></div>
                            </td>   
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:GridView>    
            
           <table align="center" border="0" cellpadding="0" cellspacing="0" width="700">
             <tr>
                <td align="right" width="100%">
                    <br />
                        <asp:LinkButton runat="server" ID="btDelete" Text="Delete" OnClick="btDelete_Click" />
                    <br /><br />
                </td>
             </tr>
           </table>
    </td>
</tr>
</table>

</ContentTemplate>
</asp:UpdatePanel>



<asp:ObjectDataSource
    ID="ObjectDataSource"
    runat="server"
    SelectMethod="GetAllLogo"
    TypeName="webapp4U.BOL.Logo">
</asp:ObjectDataSource>        


<asp:ObjectDataSource
    ID="SearchDataSource"
    runat="server"
    SelectMethod="GetLogoByPosition"
    TypeName="webapp4U.BOL.Logo">
    <SelectParameters>
        <asp:ControlParameter ControlID="dlPosition" Name="Position" PropertyName="SelectedValue" Type="int32" DefaultValue="-1"  />
    </SelectParameters>
</asp:ObjectDataSource>        



</asp:Content>

